this.name					= "missileRack";
this.author					= "Thargoid, with optimisation by Eric Walsh";
this.copyright				= "Creative Commons: attribution, non-commercial, sharealike.";
this.description				= "Script for missile rack";
this.version				= "0.2";

this.rackRefresh = function()
	{ 
	if (0 < oolite.compareVersion("1.72")) 
		{ 
		// 1.71.x or earlier 
		this.thePlayerShip = player; 
		} 
	else 
		{ 
		// 1.72 or later 
		this.thePlayerShip = player.ship; 
		}
	this.launchRack = this.ship.scriptInfo.launchingRack;
	switch(this.launchRack)
		{
		case "EQ_IRACK_0_MISSILE":
                case "EQ_NRACK_0_MISSILE":
                case "EQ_HRACK_0_MISSILE":
			{
			player.consoleMessage("Missile rack empty - ejecting.",6);
			this.thePlayerShip.spawnOne("missileRack_spentRack");
			break;
			}
		default:
			{
			this.thePlayerShip.awardEquipment(this.launchRack);
			break;
			}
		}
	}